package com.sync.data.mce.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sync.data.base.BaseEntity;
import com.sync.data.common.annotation.FieldProps;
import com.sync.data.common.annotation.FieldType;
import com.sync.data.common.annotation.RenderAs;
import com.sync.data.common.annotation.RenderType;
import com.sync.data.common.obj.annoation.ObjectPrefix;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Entity;
import javax.persistence.Transient;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * 卫生保健从业人员信息表(mdm_hcp: table)实体类
 *
 * @author zxr
 * @since 2024-08-05 18:50:31
 */
@Getter
@Setter
@Entity
@ObjectPrefix("mdhc")
public class MdmHcp extends BaseEntity {

    @OneToOne(fetch= FetchType.LAZY)
    @JoinColumn(name = "hcoId", referencedColumnName = "id", insertable = false, updatable = false)
    @NotFound(action = NotFoundAction.IGNORE)
    private MdmHosp mdmHosp;

    @FieldProps(type = FieldType.STRING, label = "客户编码",readOnly = true,message="医生编码将在审批通过后自动生成")
    private String hcpCode;

    @FieldProps(type = FieldType.STRING, label = "姓名",notNull = true)
    private String hcpName;

//    @FieldProps(type = FieldType.STRING, label = "医生照片",notNull = true)
//    private String hcpPhoto;

    @Transient
    @FieldProps(type = FieldType.STRING, label = "所属机构编码",reference = "mdmHosp.hcoCode",readOnly = true)
    private String hcoCode;

    @FieldProps(type = FieldType.STRING, label = "机构名称" ,reference = "mdmHosp.hcoName")
    private String hcoName;

    @FieldProps(type = FieldType.STRING, label = "机构名称", sourceObject = "MdmHosp", renderField = "mdmHosp", renderType = RenderType.SourcePicker,notNull = true)
    private String hcoId;

    @FieldProps(type = FieldType.DICT, label = "性别",notNull = true, renderType = RenderType.Select)
    private String hcpGender;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @FieldProps(type = FieldType.DATE,label = "生日",notNull = true,renderType = RenderType.DatePicker)
    private Date hcpBirthday;

    @FieldProps(type = FieldType.STRING, label = "挂牌科室",notNull = true)
    private String listedDepartment;

    @FieldProps(type = FieldType.DICT, label = "标准科室",notNull = true, renderType = RenderType.Select)
    private String departName;

    @FieldProps(type = FieldType.DICT, label = "职务",notNull = true, renderType = RenderType.Select)
    private String hcpBizTitle;


    @FieldProps(type = FieldType.DICT, label = "职称",notNull = true, renderType = RenderType.Select)
    private String hcpProfessionalTitle;


    @FieldProps(type = FieldType.DICT, label = "学术头衔",notNull = true, renderType = RenderType.Select)
    private String academicTitle;


    @FieldProps(type = FieldType.STRING, label = "社会任职",notNull = true)
    private String socialAppointments;

    @FieldProps(type = FieldType.DICT, label = "医生类型",notNull = true, renderType = RenderType.Select)
    private String hcpType;


    @FieldProps(type = FieldType.DICT, label = "执业证书类型",notNull = true, renderType = RenderType.Select)
    private String practisingCertificateType;


    @FieldProps(type = FieldType.STRING, label = "执业证书编码",notNull = true)
    private String practisingCertificateCode;

    @FieldProps(type = FieldType.DICT, label = "教育背景",notNull = true, renderType = RenderType.Select)
    private String eduBkgd;

    @FieldProps(type = FieldType.DICT, label = "专业经历",notNull = true, renderType = RenderType.Select)
    private String workExperience;

    @FieldProps(type = FieldType.STRING, label = "毕业院校",notNull = true)
    private String university;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @FieldProps(type = FieldType.DATE,label = "毕业时间",notNull = true,renderType = RenderType.DatePicker)
    private Date graduateTime;

    @FieldProps(type = FieldType.STRING, label = "擅长",notNull = true)
    private String hcpPriSpecialty;

    @FieldProps(type = FieldType.STRING, label = "简介",notNull = true)
    private String briefIntroduction;

    @FieldProps(type = FieldType.DICT, label = "状态",notNull = true, renderType = RenderType.Select)
    private String hcpStatus;

    @FieldProps(type = FieldType.STRING, label = "状态原因",notNull = true)
    private String statusReason;

    @FieldProps(type = FieldType.STRING, label = "服务类型", renderType = RenderType.Select)
    private String serviceType;

    @FieldProps(type = FieldType.STRING, label = "姓（中文）")
    private String hcpFirstname;

    @FieldProps(type = FieldType.STRING, label = "名（中文）")
    private String hcpLastname;

    @FieldProps(type = FieldType.STRING, label = "姓（英文）")
    private String hcpFirstnameEn;

    @FieldProps(type = FieldType.STRING, label = "名（英文）")
    private String hcpLastnameEn;

    @FieldProps(type = FieldType.STRING, label = "姓名（英文）")
    private String hcpNameEn;

    @FieldProps(type = FieldType.STRING, label = "职业类别")
    private String hcpProfessionalType;

    @FieldProps(type = FieldType.STRING, label = "学术职称")
    private String hcpAcademicTitle;

    @FieldProps(type = FieldType.STRING, label = "职业编号")
    private String hcpProfessionNo;

    @FieldProps(type = FieldType.STRING, label = "international hcp")
    private String hcpInternational;

    @FieldProps(type = FieldType.STRING, label = "国籍")
    private String hcpNationality;

    @FieldProps(type = FieldType.STRING, label = "是否kol")
    private String hcpKol;

    @FieldProps(type = FieldType.STRING, label = "kol tier")
    private String hcpTier;



    @FieldProps(type = FieldType.DICT, label = "是否讲者", renderType = RenderType.Select)
    private String hcpIsSpeaker="0";


    @FieldProps(type = FieldType.STRING, label = "文凭")
    private String hcpPriCredential;

    @FieldProps(type = FieldType.STRING, label = "专业资格")
    private String hcpProfDesig;

    @FieldProps(type = FieldType.STRING, label = "第二专长领域")
    private String hcpSecondSpecialty;

    @FieldProps(type = FieldType.STRING, label = "第三专长领域")
    private String hcpThirdSpecialty;

    @FieldProps(type = FieldType.STRING, label = "商务邮箱")
    private String hcpBizEmail;

    @FieldProps(type = FieldType.STRING, label = "联系电话")
    private String hcpPhone;

    @FieldProps(type = FieldType.STRING, label = "手机")
    private String hcpMobile;

    @FieldProps(type = FieldType.STRING, label = "传真")
    private String hcpFax;

    @FieldProps(type = FieldType.STRING, label = "个人邮箱")
    private String hcpPersonEmail;

    @FieldProps(type = FieldType.STRING, label = "微信号id")
    private String hcpWechatId;

    @FieldProps(type = FieldType.STRING, label = "国家")
    private String hcpCountry;

    @FieldProps(type = FieldType.STRING, label = "大区/州")
    private String hcpRegion;

    @FieldProps(type = FieldType.STRING, label = "省份")
    private String hcpProvince;

    @FieldProps(type = FieldType.STRING, label = "城市")
    private String hcpCity;

    @FieldProps(type = FieldType.STRING, label = "行政区")
    private String hcpDistrict;

    @FieldProps(type = FieldType.STRING, label = "地址")
    private String hcpAddress;

    @FieldProps(type = FieldType.STRING, label = "邮编")
    private String hcpPostCode;

    @FieldProps(type = FieldType.STRING, label = "主执业科室编码")
    private String departCode;

    @FieldProps(type = FieldType.STRING, label = "自定义科室名称")
    private String hcpDepartCustom;

    @FieldProps(type = FieldType.STRING, label = "证件类型")
    private String hcpIdType;

    @FieldProps(type = FieldType.STRING, label = "证件号码")
    private String hcpIdNum;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @FieldProps(type = FieldType.DATE,label = "证件过期日期",renderType = RenderType.DatePicker)
    private Date hcpIdExpireDate;

    @FieldProps(type = FieldType.STRING, label = "银行名称")
    private String hcpBankName;

    @FieldProps(type = FieldType.STRING, label = "银行账户")
    private String hcpBankAccount;

    @FieldProps(type = FieldType.STRING, label = "发票地址")
    private String hcpBillAddr;

    @FieldProps(type = FieldType.STRING, label = "主要地址")
    private String hcpPriAddr;

    @FieldProps(type = FieldType.STRING, label = "邮寄地址")
    private String hcpShipAddr;

    @FieldProps(type = FieldType.STRING, label = "hcp验证状态")
    private String hcpValidateStatus;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @FieldProps(type = FieldType.DATE,label = "hcp验证时间",renderType = RenderType.DatePicker)
    private Date hcpValidateTime;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @FieldProps(type = FieldType.DATE,label = "hcp确认时间",renderType = RenderType.DatePicker)
    private Date hcpConfirmTime;

    @FieldProps(type = FieldType.STRING, label = "onekey id")
    private String onekeyId;

    @FieldProps(type = FieldType.STRING, label = "veeva id")
    private String veevaId;

    @FieldProps(type = FieldType.STRING, label = "url信息")
    private String hcpWebUrl;

    @FieldProps(type = FieldType.STRING, label = "自定义信息")
    private String hcpCustomInfo;

    @FieldProps(type = FieldType.STRING, label = "备注")
    private String hcpComment;

    @FieldProps(type = FieldType.STRING, label = "是否允许接触")
    private String allowToContact;

    @FieldProps(type = FieldType.STRING, label = "是否同意电话联系")
    private String phoneOptOut;

    @FieldProps(type = FieldType.STRING, label = "是否同意邮件联系")
    private String mailOptOut;

    @FieldProps(type = FieldType.STRING, label = "是否同意拜访")
    private String visitOptOut;

    @FieldProps(type = FieldType.STRING, label = "是否同意传真联系")
    private String faxOptOut;

    @FieldProps(type = FieldType.STRING, label = "是否同意短信联系")
    private String smsOptOut;

    @FieldProps(type = FieldType.STRING, label = "是否同意微信联系")
    private String wechatOptOut;

    @FieldProps(type = FieldType.STRING, label = "是否同意远程拜访")
    private String remoteOptOut;

    @FieldProps(type = FieldType.STRING, label = "原始数据来源")
    private String dataFrom;

    @FieldProps(type = FieldType.STRING, label = "原始数据id")
    private String legacyId;

    @FieldProps(type = FieldType.DICT, label = "数据状态", renderType = RenderType.Select,renderAs = RenderAs.Tag)
    private String isActive;


    @FieldProps(type = FieldType.STRING, label = "所属部门")
    private String sysOrgCode;

    @FieldProps(type = FieldType.STRING, label = "删除状态")
    private String delFlag;

    @FieldProps(type = FieldType.STRING, label = "版本号")
    private Integer version;

    public void setHcpName(String hcpName) {
        this.hcpName = hcpName;
        this.name = hcpName;
    }
}

